<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://www.unpkg.com/ew-color-picker/dist/ew-color-picker.min.css">
    <style>
        button {
            float: right;
        }
    </style>
</head>

<body>
    <div></div>
    <button type="button" id="openBtn">开启颜色选择器</button>
    <button type="button" id="closeBtn">关闭颜色选择器</button>
    <script src="https://www.unpkg.com/ew-color-picker/dist/ew-color-picker.js"></script>
    <script>
        const color = new ewColorPicker({
            el: 'div',
            isClickOutside: false,
            hasBox: false
        });
        const $ = (id) => document.getElementById(id);
        $('closeBtn').onclick = () => color.closePicker();
        $('openBtn').onclick = () => color.openPicker();
    </script>
</body>

</html>